package thread;

import java.io.*;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * Created by yangluhua on 2016/9/28 0028.
 */
public class ReadFile {
    private FileInputStream fileInputStream;

    public static void main(String[] args) throws Exception {
        //Executor executor = Executors.newCachedThreadPool();
        FileLineThread fileLineThread = null;
        for(int i =1 ;i < 6;i++){
            fileLineThread = new FileLineThread(i,"E:/key.txt");
            fileLineThread.start();
            //fileLineThread.join();
        };
    }
}

class FileLineThread extends Thread{
    private int line ;
    private String name;
    public FileLineThread(int line, String name) {
        this.line = line;
        this.name = name;
    }

    @Override
    public void run() {
        try {
            RandomReadFileLineUtils.dataReader(name,line,line);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
